<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use backend\models\SysItem;
use backend\models\Fabric;

	    if (count($_GET) > 0) {
	  	 	$_POST = array();
		}
		if (count($_POST) > 0) {
			$_POST = array();
		}
		if (count($_FILES) > 0) {
			$_FILES = array();
		}
		
		$this->title = Yii::t('app','Upload Image');
		$this->params['breadcrumbs'][] = ['label' => Yii::t('app','Sys Items'), 'url' => ['index']];
		$this->params['breadcrumbs'][] = $this->title;
?>
<script type="text/javascript">
<!--
function div_focus(row)
{
	alert(row);
	$("#row"+row).css("background-color","#920");
	
}
function div_blur($id)
{
	$("#row"+$id).css("background-color","#ccc");
	
}

//-->
</script>

<?php $form = ActiveForm::begin(['options' => ['enctype' => 'multipart/form-data']]) ?>


<?=$form->field($model, 'image_upload')->fileInput(['class'=>'btn','style'=>'background-color:#ccc']) ?>



<button class='btn btn-primary' style='width:100%;'>图片上传</button>

<?php ActiveForm::end() ?>


<div id='haved_fabric'></div>

		<div style='height:100px;width:100%;margin:5px;text-align:center;border-bottom:1px solid #ccc;'>
			<div style='width:10%;text-align:center;padding:5px;display:inline;font-size:18px;'></div>
			<div style='text-align:center;padding:5px;display:inline;'>
				<?php if($model->url!="") {?> 
				<img style='height:80%;margin:10px;border:1px solid #ccc;padding:5px;' src = <?=Yii::getAlias('@web').'/'.$model->url ?> />
			 
				<?php }?>
			</div>
	 
		 
		</div>	